package com.yanmaohu.yulia.bean;

/**
 * @author Bright Lee
 */
public final class FieldReference implements NonparenthesizedValueExpressionPrimary {

    private int beginIndex;
    private int endIndex;
    private ValueExpressionPrimary valueExpressionPrimary;
    private Identifier fieldName;

    public FieldReference(ValueExpressionPrimary valueExpressionPrimary, Identifier fieldName) {
        this.beginIndex = valueExpressionPrimary.getBeginIndex();
        this.endIndex = fieldName.getEndIndex();
        this.valueExpressionPrimary = valueExpressionPrimary;
        this.fieldName = fieldName;
    }

    public int getBeginIndex() {
        return beginIndex;
    }

    public int getEndIndex() {
        return endIndex;
    }

    public ValueExpressionPrimary getValueExpressionPrimary() {
        return valueExpressionPrimary;
    }

    public Identifier getFieldName() {
        return fieldName;
    }

}
